#include "vector.h"

void TestVector1()
{
	lwl::vector<int> v1;
	lwl::vector<int> v2(10, 5);

	int array[] = { 1,2,3,4,5 };
	lwl::vector<int> v3(array, array + sizeof(array) / sizeof(array[0]));

	lwl::vector<int> v4(v3);

	for (size_t i = 0; i < v2.size(); ++i)
	{
		std::cout << v2[i] << " ";
	}
	std::cout << "\n";


	for (auto it = v3.begin(); it != v3.end(); it++)
	{
		std::cout << *it << " ";
	}
	std::cout << "\n";

	for (auto e : v4)
	{
		std::cout << e << " ";
	}
	std::cout << "\n";
}

void TestVector2()
{
	lwl::vector<int> v;
	v.push_back(1);
	v.push_back(2);
	v.push_back(3);
	v.push_back(4);
	v.push_back(5);
	std::cout << v.size() << std::endl;
	std::cout << v.capacity() << std::endl;
	std::cout << v.front() << std::endl;
	std::cout << v.back() << std::endl;
	std::cout << v[0] << std::endl;
	for (auto e : v)
	{
		std::cout << e << " ";
	}
	std::cout << "\n";

	v.pop_back();
	v.pop_back();
	for (auto e : v)
	{
		std::cout << e << " ";
	}
	std::cout << "\n";

	v.insert(v.begin(), 0);
	for (auto e : v)
	{
		std::cout << e << " ";
	}
	std::cout << "\n";

	v.erase(v.begin() + 1);
	for (auto e : v)
	{
		std::cout << e << " ";
	}
	std::cout << "\n";
}

int main()
{
	TestVector1();
	TestVector2();
	return 0;
}